package com.haixiaoke.saas.cleaner.service.impl;

import com.haixiaoke.saas.cleaner.domain.SweepProcessRecord;
import com.haixiaoke.saas.cleaner.mapper.SweepProcessRecordMapper;
import com.haixiaoke.saas.cleaner.service.ISweepProcessRecordService;
import com.haixiaoke.saas.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 打扫流程记录Service业务层处理
 *
 * @author xiaoilong
 * @date 2024-05-11
 */
@Service
public class SweepProcessRecordServiceImpl implements ISweepProcessRecordService {
    @Autowired
    private SweepProcessRecordMapper sweepProcessRecordMapper;

    /**
     * 查询打扫流程记录
     *
     * @param sweepProcessId 打扫流程记录主键
     * @return 打扫流程记录
     */
    @Override
    public SweepProcessRecord selectSweepProcessRecordBySweepProcessId(Long sweepProcessId) {
        return sweepProcessRecordMapper.selectSweepProcessRecordBySweepProcessId(sweepProcessId);
    }

    /**
     * 查询打扫流程记录列表
     *
     * @param sweepProcessRecord 打扫流程记录
     * @return 打扫流程记录
     */
    @Override
    public List<SweepProcessRecord> selectSweepProcessRecordList(SweepProcessRecord sweepProcessRecord) {
        return sweepProcessRecordMapper.selectSweepProcessRecordList(sweepProcessRecord);
    }

    /**
     * 新增打扫流程记录
     *
     * @param sweepProcessRecord 打扫流程记录
     * @return 结果
     */
    @Override
    public int insertSweepProcessRecord(SweepProcessRecord sweepProcessRecord) {
        sweepProcessRecord.setCreateTime(DateUtils.getNowDate());
        return sweepProcessRecordMapper.insertSweepProcessRecord(sweepProcessRecord);
    }

    /**
     * 修改打扫流程记录
     *
     * @param sweepProcessRecord 打扫流程记录
     * @return 结果
     */
    @Override
    public int updateSweepProcessRecord(SweepProcessRecord sweepProcessRecord) {
        sweepProcessRecord.setUpdateTime(DateUtils.getNowDate());
        return sweepProcessRecordMapper.updateSweepProcessRecord(sweepProcessRecord);
    }

    /**
     * 批量删除打扫流程记录
     *
     * @param sweepProcessIds 需要删除的打扫流程记录主键
     * @return 结果
     */
    @Override
    public int deleteSweepProcessRecordBySweepProcessIds(Long[] sweepProcessIds) {
        return sweepProcessRecordMapper.deleteSweepProcessRecordBySweepProcessIds(sweepProcessIds);
    }

    /**
     * 删除打扫流程记录信息
     *
     * @param sweepProcessId 打扫流程记录主键
     * @return 结果
     */
    @Override
    public int deleteSweepProcessRecordBySweepProcessId(Long sweepProcessId) {
        return sweepProcessRecordMapper.deleteSweepProcessRecordBySweepProcessId(sweepProcessId);
    }

    @Override
    public int insertSweepProcessRecordList(List<SweepProcessRecord> sweepProcessRecordList) {
        return sweepProcessRecordMapper.insertSweepProcessRecordList(sweepProcessRecordList);
    }

    @Override
    public int updateSweepProcessRecordList(List<SweepProcessRecord> sweepProcessRecordList) {
        return sweepProcessRecordMapper.updateSweepProcessRecordList(sweepProcessRecordList);
    }

    @Override
    public int updateSweepProcessRecordByHouseSweepIds(SweepProcessRecord sweepProcessRecord) {
        return sweepProcessRecordMapper.updateSweepProcessRecordByHouseSweepIds(sweepProcessRecord);
    }
}
